﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bzure.Common.Transactions
{
    public interface ITransactionFactor
    {
        ITransactionSupport FactorHost { get; }
        void Execute();
    }
    public class TransactionFactor<Contract, T> : ITransactionFactor where Contract : ITransactionSupport
    {
        public ITransactionSupport FactorHost { get; private set; }
        public TransactionFactor(Contract SupportHost)
        {
            this.FactorHost = SupportHost;
        }
        public Action<T> Action { get; set; }
        public T ActionBody { get; set; }
        public void Execute()
        {
            this.Action(this.ActionBody);
        }

    }
}
